<?php
header("Content-Type:text/html;charset=utf-8");
	session_start();//开启session会话
	const DSN = 'mysql:host=localhost;dbname=kp_upload';
	const DBUSER = 'root';
	const DBPWD = 'root';
	$pdo = new PDO(DSN, DBUSER, DBPWD);	//创建pdo对象
	//$pdo->setAutoCommit(false); //设置不会自动提交 
	$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);  //设置错误模式,发生错误时抛出异常
	$uid = empty($_SESSION['user']['uid']) ? 0 : (int)$_SESSION['user']['uid'];			//用户登陆ID
	//$adminId= empty($_SESSION['adminId']) ? 0 : $_SESSION['adminId'];//后台登陆ID
	define('ROOT',str_replace('\\', '/', dirname(__FILE__).'/')); 	//根目录常量


?>